package entity;

import java.io.Serializable;

/**
 * @author lscl
 * @version 1.0
 * @intro: 前后端的通用响应实体
 */
public class Result implements Serializable {

    // 请求是否成功
    private Boolean flag;

    // 响应的状态码
    private Integer code;

    // 响应的信息
    private String message;

    // 响应的数据
    private Object data;

    public Result() {
    }

    public Result(Integer code, Boolean flag, String message) {
        this.flag = flag;
        this.code = code;
        this.message = message;
    }

    public Result(Boolean flag, Integer code, String message) {
        this.flag = flag;
        this.code = code;
        this.message = message;

    }

    public Result(Integer code, Boolean flag, String message, Object data) {
        this.flag = flag;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Result(Boolean flag, Integer code, String message, Object data) {
        this.flag = flag;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public Boolean getFlag() {
        return flag;
    }

    public void setFlag(Boolean flag) {
        this.flag = flag;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
